#include "d_Math.h"

using namespace d_Math;

#ifndef D_FRUSTUM_H
#define D_FRUSTUM_H

namespace d_Math
{

class d_Frustum {

private:

	enum {
		TOP = 0, BOTTOM, LEFT,
		RIGHT, NEARP, FARP
	};

public:
	d_Frustum();
	d_Plane *pl[6];
	void draw();
	bool changed;
	bool first_time;

	d_Vec3f ntl,ntr,nbl,nbr,ftl,ftr,fbl,fbr,camp,camd;
	float nearD, farD, ratio, angle,tang;
	float nw,nh,fw,fh;

	void setCamInternals(float angle, float ratio, float nearD, float farD);
	void setCamDef(d_Vec3f p, d_Vec3f l, d_Vec3f u);
	//int pointInFrustum(d_Vec3f &p);
	//int sphereInFrustum(d_Vec3f &p, float raio);
	int boxInFrustum(d_AABB *b);

};

}

#endif
